import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    user
  },
  getters: {
    token: state => state.user.token,
    userId: state => state.user.userId,
    username: state => state.user.username,
    nickname: state => state.user.nickname || state.user.username,
    email: state => state.user.email
  }
}) 